home *** CD-ROM | disk | FTP | other *** search
/ Trading on the Edge / Trading On The Edge - CD-ROM Toolkit (Wayzata Technology)(2031)(1994).bin / pc / mac_file / vendor_d / neuralwa / nw2v50 / easyprob.ipb < prev    next >
Text File  |  1993-08-23  |  9KB  |  405 lines

  1. inst4.0        ! Oct 29 1990
  2. !****************************************************************
  3. !*                                *
  4. !*    Easy Probe Script                    *
  5. !*                                *
  6. !****************************************************************
  7. !
  8. !Preliminaries
  9. !
  10. =PNam    "Output"        !Start off with default probe
  11. !
  12. @LLsl                !Load super layer
  13. ?EPEp    0            !Epoch requested
  14. >beq    Aux1Set            !No
  15. ?Lax1    0            !Has Aux 1 (Epoch) been set up?
  16. >bgt    Aux1Set            !Yes
  17. =Lax1    16            !Set a default value
  18. @SVsl
  19. :Aux1Set
  20. !Calculate output layer number (n5) and #PEs in output (n4)
  21. @LLsl                !Load super layer
  22. =n5    Lpes            !number of layers
  23. -n5    1            !output layer number
  24. =LayN    n5            !Look at output layer
  25. @LLly                !Load it
  26. =n4    Lpes            !# PEs in output layer
  27. !Use n7 to flag a potentially bipolar output
  28. =n7    0            !Unipolar by default
  29. ?Ltrn    "Sigmoid"        !Sigmoid?
  30. >beq    UniPolar        !Yes
  31. ?Ltrn    "Perceptron"        !Perceptron?
  32. >beq    UniPolar        !Yes
  33. ?Ltrn    "StepFunction"        !Step function?
  34. >beq    UniPolar        !Yes
  35. ?Lcmp    "Direct"        !Direct
  36. >bne    UniPolar        !No
  37. ! Direct, non-sigmoid are potentially BiPolar
  38. =n7    1            !Bipolar
  39. :UniPolar
  40. !Calculate #PEs in network (n6)
  41. =n6    n4            !# PEs in network (Except input and bias)
  42. =LayN    n5            !Output layer
  43. :CountPEs
  44. -LayN    1            !Next layer Down
  45. ?LayN    0            !At Input layer?
  46. >ble    PEsCnted        !Yes
  47. @LLly                !Load next layer
  48. +n6    Lpes            !increment number of PEs
  49. >br    CountPEs
  50. :PEsCnted
  51. !
  52. ! Now check if we need to prompt for probes
  53. ?EPPb    2            !Layer Probe?
  54. >beq    PromptPb        !Yes
  55. ?EPPb    4            !PE Probe?
  56. >beq    PromptPb        !Yes
  57. >br    NoPrompt        !Don't Prompt
  58. :PromptPb
  59. @Vars    NP            !Prompt for near layer and position
  60. @NrLX                !Get layer index of PE
  61. ?NPEl    0
  62. >bge BldProbe
  63. @Err    "Invalid PE (Bias) selected for instrument"
  64. !
  65. :BldProbe            ! Need to construct a probe
  66. ?EPPb    4            ! PE Probe?
  67. >beq    PEProbe
  68. =PNam    "_lay_"
  69. +PNam    NPEl            !Append layer number to name
  70. @PbAS                !Add Probe
  71. @PbDC                !Delete all components
  72. @PALy                !Add Near Layer to Probe
  73. ! Now save #PEs in layer for future reference
  74. =LayN    NPEl            !Pointed to layer
  75. @LLly                !Load it
  76. =n4    Lpes            !# PEs in Probe
  77. =n3    n4
  78. /n3    LDnr            !Divide by #rows in display
  79. >br    BldInstr
  80. !
  81. :PEProbe
  82. =PNam    "_pe_"            !prefix
  83. +PNam    NPEn            !Index in layer
  84. @PbAS                !Add Probe
  85. ?PbSt    0            !Check status of probe
  86. >bne    PEPbOK            !OK, not there yet
  87. =n0    n6            !Look for Unique probe
  88. =n1    n0
  89. +n1    100            !Give up after 100
  90. :PEPb1
  91. +n0    1
  92. ?n0    n1
  93. >beq    PEPb2
  94. =PNam    "_pe_"            !prefix
  95. +PNam    n0            !Arbitrary suffix
  96. @PbAS                !Add Probe
  97. ?PbSt    0            !Check status of probe
  98. >beq    PEPb1            !Already there, try again
  99. :PEPbOK
  100. @PAPE                !Add Near PE to probe
  101. =n4    1            !# PEs in Probe
  102. =n3    1            !#x
  103. >br    BldInstr
  104. :PEPb2
  105. @Err    "Probe table full; cannot create confusion matrix"
  106.  
  107. :NoPrompt
  108. @Vars    P            !Prompt position only
  109. ?EPPb    0            !Network Probe?
  110. >bne    NotNetWk
  111. =n4    n6            !# PEs in Probe
  112. =n3    n6            !#x
  113. >br    BldInstr
  114. :NotNetWk
  115. ?EPPb    1            !Output Probe?
  116. >bne    NotOutLy
  117. =LayN    n5            !Output layer
  118. @LLly                !Load it
  119. =n4    Lpes            !# PEs in Probe
  120. =n3    n4
  121. /n3    LDnr            !Divide by #rows in display
  122. ! If it is the output layer and the graph is a histogram,
  123. ! we must build a probe consisting of just the output
  124. ! layer. The default probe which consists of all layers
  125. ! except the input layer will not do because a histogram
  126. ! instrument will read all the values off the probe. Note:
  127. ! Only do this for Histograms, otherwise NeuralWorks
  128. ! Explorer will not be able to do other output instruments
  129. ?EPGr    3            !Histogram?
  130. >bne    BldInstr        !No
  131. =PNam    "_out_lay"        !Probe name
  132. =NPEl    n5            !Output Layer
  133. @NrPE                !Point to it
  134. @PbAS                !Add Probe
  135. @PbDC                !Delete all components
  136. @PALy                !Add Near Layer to Probe
  137. >br    BldInstr
  138. :NotOutLy
  139. ! Must be input layer
  140. =LayN    0
  141. @LLly                !Load it
  142. =n4    Lpes            !# PEs in Probe
  143. =n3    n4
  144. /n3    LDnr            !Divide by #rows in display
  145. ! Add input layer probe
  146. =PNam    "_in_lay"        !Probe name
  147. =NPEl    0            !Input Layer
  148. @NrPE                !Point to it
  149. @PbAS                !Add Probe
  150. @PbDC                !Delete all components
  151. @PALy                !Add Near Layer to Probe
  152. !
  153. :BldInstr
  154. @ILdD                !load default instrument
  155. !
  156. !    *** Calculate # plots and #x ***
  157. !
  158. ! Defaults:
  159. !
  160. =Inpl    n4            !Default: Total # PEs in Probe
  161. =Ignx    n3            !Default: As defined above
  162. =ICAc    0            !No convergence criterion
  163. =ICTh    0.0            !Zero convergence threshold
  164. !
  165. ! RMS over layer is an exception to #plots:
  166. !
  167. ?EPVr    1            !RMS error over layer?
  168. >bne    NumPl1            !No
  169. >br    NumPl3
  170. ?EPVr    6            !RMS Weights over layer?
  171. >bne    NumPl1            !No
  172. :NumPl3
  173. ?EPPb    0            !Network Probe?
  174. >bne    NumPl2            !No
  175. =Inpl    n5
  176. -Inpl    1            !#layers - 1
  177. =Ignx    Inpl
  178. >br    NumPl1
  179. :NumPl2
  180. =Inpl    1
  181. =Ignx    1
  182. :NumPl1
  183. !
  184. !    *** Graph Type dependent stuff ***
  185. !
  186. !    *** STRIP CHARTS ***
  187. !
  188. ! #x for Strip charts is an exception:
  189. ?EPGr    0            !Strip chart?
  190. >bne    NotStrip        !No
  191. =Ignx    100            !Nominal # plot points
  192. =Ihgt    64            !Nominal Height
  193. =Iwdt    300            !Nominal Width
  194. ?EPEp    0            !Epoch Option?
  195. >bne    Strip1            !Yes
  196. =ILDv    10            !Nominal Learn Divisor
  197. :Strip1
  198. ! Set up convergence criterion if RMS Error strip
  199. ?EPVr    1            !RMS Error over layer?
  200. >bne    EndGType        !No
  201. ?EPPb    1            !Output layer?
  202. >bne    EndGType        !No
  203. ! Don't activate criterion because of Radial Basis Function Nets
  204. ! Just set up threshold
  205. !=ICAc    1            !Activate convergence criterion
  206. =ICTh    0.001            !Low convergence threshold
  207. >br    EndGType
  208. !
  209. !    *** HISTOGRAMS ***
  210. !
  211. ! #plots for Histograms is an exception:
  212. :NotStrip
  213. ?EPGr    3            !Histogram?
  214. >bne    NotHisto        !No
  215. =Ignx    30            !Nominal # Bins
  216. =Ihgt    64            !Nominal Height
  217. =Iwdt    300            !Nominal Width
  218. =ILDv    5            !Nominal Learn Divisor
  219. ?EPEp    0            !Epoch Option?
  220. >bne    Histo1            !Yes
  221. =ILDv    20            !Nominal Learn Divisor
  222. :Histo1
  223. >br    EndGType
  224. !
  225. !
  226. !    *** CONFUSION MATRICES ***
  227. !
  228. ! #plots and #x for Confusion matrices are exceptions
  229. :NotHisto
  230. ?EPGr    4            !Confusion Matrix?
  231. >bne    NotConfM        !No
  232. =Ignx    9
  233. =Inpl    81
  234. =Ihgt    90            !Nominal Height
  235. =Iwdt    90            !Nominal Width
  236. =ILDv    5            !Every 5 Epochs
  237. ! Epoch is forced for Confusion matrix
  238. =EPEp    1            !Force epoch
  239. >br    EndGType
  240. !
  241. !
  242. !
  243. !    *** CLASSIFICATION RATE MATRICES ***
  244. !
  245. ! #plots and #x for Classification rate matrices are exceptions
  246. :NotConfM
  247. ?EPGr    6            !Classification rate?
  248. >bne    NotClsRt        !No
  249. =Ignx    Inpl            !#PEs
  250. ?Ignx    2            !At least two?
  251. >bge    ClsRt1
  252. =Ignx    2            !Make it two
  253. :ClsRt1
  254. =Inpl    Ignx
  255. *Inpl    Ignx            !squared
  256. =Ihgt    Ignx
  257. *Ihgt   35            !Nominal Height
  258. =Iwdt    Ignx
  259. *Iwdt    65            !Nominal Width
  260. =ILDv    5            !Every 5 Epochs
  261. ! Epoch is forced for Classification Rate matrix
  262. =EPEp    1            !Force epoch
  263. >br    EndGType
  264. !
  265. !
  266. !    *** BAR, MATRIX, HINTON ***
  267. !
  268. :NotClsRt
  269. ! Try to set a good height and width
  270. =Iwdt    Ignx
  271. =Ihgt    Inpl
  272. /Ihgt    Ignx
  273. *Iwdt    10
  274. *Ihgt    10
  275. =n0    64
  276. ?Iwdt    n0
  277. >bgt    Bar1
  278. =Iwdt    n0
  279. :Bar1
  280. ?Ihgt    n0
  281. >bgt    EndGType
  282. =Ihgt    n0
  283. !
  284. :EndGType
  285. !
  286. !    *** Other Default stuff ***
  287. !
  288. =IEpc    EPEp            !Set epoch flag
  289. =ILnA    1            !Active in Learn
  290. =IRcA    0            !NOT Active in recall
  291. =IGTy    EPGr            !Graph Type
  292. =IGVr    "CurErr"        !Variable
  293. =ITTy    "RMS"            !RMS Transformation Type
  294. =ITMd    0            !No Transformation
  295. =IPrb    PNam            !Point to probe
  296. ! Use n2 to flag -ve vmin; this is a fairly complicated
  297. ! function of variable type, graph type and epoch option,
  298. ! so it is difficult to come up with a good default, and
  299. ! there are several exceptions below
  300. =n2    1            !Negative vmin
  301. ! Most epoch graphs should have non-negative vmin
  302. ! (exceptions: Histogram, Confusion Matrix, Classification Rate)
  303. ! vmin for Non-epoch graphs needs to be determined based
  304. ! on variable type.
  305. ?EPEp    0            !Epoch Option?
  306. >beq    VMin1            !No
  307. ?EPGr    3            !Histogram?
  308. >beq    VMin1            !Yes
  309. ?EPGr    4            !Confusion Matrix?
  310. >beq    VMin1            !Yes
  311. ?EPGr    6            !Classification Rate?
  312. >beq    VMin1            !Yes
  313. =n2    0            !Non-Negative vmin
  314. :VMin1
  315. !
  316. !    *** Variable dependent stuff ***
  317. !    
  318. !    *** PE ERROR ***
  319. !
  320. ?EPVr    0            !PE Error?
  321. >bne    NotPEErr        !No
  322. =ITit    "PE Error"        !Instrument title
  323. =Ivmx    1.0            !Maximum plotted value
  324. >br    NotRMSLy
  325. !
  326. !    *** RMS ERROR ***
  327. !
  328. :NotPEErr
  329. ?EPVr    1            !RMS Error over layer?
  330. >bne    NotRMSEr        !No
  331. =ITit    "RMS Error"        !Instrument title
  332. =ITMd    2            !Transform over component
  333. =n2    0            !Always non-negative vmin
  334. =Ivmx    1.0            
  335. >br    NotRMSLy
  336. !
  337. !    *** OUTPUT VALUE ***
  338. !
  339. :NotRMSEr
  340. ?EPVr    2            !Output Value?
  341. >bne    NotOutpV        !No
  342. =ITit    "Output Value"        !Instrument title
  343. =IGVr    "Out"            !Plot Output
  344. =Ivmx    1.0            !Maximum plotted value
  345. =IRcA    1            !ACTIVE in recall
  346. ?n2    0            !potentially negative vmin?
  347. >beq    OutpV1            !No
  348. ?n7    0            !BiPolar Output?
  349. >bne    OutpV1            !Yes
  350. =n2    0            !Non-negative vmin
  351. :OutpV1
  352. >br    NotRMSLy
  353. !
  354. !    *** SUMMATION VALUE ***
  355. !
  356. :NotOutpV
  357. ?EPVr    3            !Summation Value?
  358. >bne    NotSumV            !No
  359. =ITit    "Summation Value"    !Instrument title
  360. =IGVr    "Sum"            !Plot Summation
  361. =Ivmx    3.0            !Maximum plotted value
  362. =IRcA    1            !ACTIVE in recall
  363. >br    NotRMSLy
  364. !
  365. !    *** INDIVIDUAL WEIGHT VALUE ***
  366. !
  367. :NotSumV
  368. ! Must be some sort of weight value. Set up default
  369. ! vmax and variable to be plotted
  370. =Ivmx    8.0
  371. =IGVr    "Weight"        !Plot Weight Value
  372. !
  373. ?EPVr    4            !Individual Weight Value?
  374. >bne    NotIndWt        !No
  375. =ITit    "Individual Weights"    !Instrument title
  376. >br    NotRMSLy
  377. !
  378. !    *** RMS WEIGHT VALUE OVER PE ***
  379. !
  380. :NotIndWt
  381. ?EPVr    5            !RMS Weight Value over PE?
  382. >bne    NotRMSPE        !No
  383. =ITit    "RMS Weights (PE)"    !Instrument title
  384. =n2    0            !Always non-negative vmin
  385. =ITMd    1            !Transform over node
  386. >br    NotRMSLy
  387. !
  388. !    *** RMS WEIGHT VALUE OVER LAYER ***
  389. !
  390. :NotRMSPE
  391. =EPVr    6            !FORCE RMS Weight Value over PE?
  392. =ITit    "RMS Weights (Layer)"    !Instrument title
  393. =n2    0            !Always non-negative vmin
  394. =ITMd    2            !Transform over component
  395. !
  396. :NotRMSLy
  397. !
  398. =Ivmn    0.0            !Minimum plotted value
  399. ?n2    0            !Signed vmin?
  400. >beq    AddInstr        !No
  401. -Ivmn    Ivmx            !Negative of vmax
  402. !
  403. :AddInstr            !Finally...
  404. @IAdd                !... add instrument
  405.